<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Array的扩展方法find</title>
</head>
<body>
  <script>
    let arr = [{
      'name':'张三',
      'id':1
    }, {
      'id':2,
      'name':'李四'
    }];
    let target = arr.find((item,index) => item.id === 2);
    console.log(target);
  </script>
</body>
</html>